履歴: 電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス

各行は、その日時に書かれた内容です。追加・削除は、1 つ前の版との行数の差です (全 27 版)。「差分」は比較する版、「基準」は比べる相手の版を選びます

日時タイトル文字数追加削除内容差分基準
2013/1/6 19:53:43電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 最新版51,093+1 -88表示差分—
2013/1/6 19:53:43電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 56,235+0 -9表示差分選択
2013/1/6 10:53:43電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 56,399+10 -0表示差分選択
2013/1/4 12:33:44電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 56,234+0 -9表示差分選択
2013/1/4 5:26:29電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 56,367+9 -0表示差分選択
2010/8/7 11:12:02電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 56,234+17 -0表示差分選択
2010/8/6 9:15:44電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 55,362+147 -0表示差分選択
2010/6/13 5:30:53電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 51,449+1 -1表示差分選択
2010/6/13 5:30:53電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 51,448+72 -28表示差分選択
2010/6/12 11:57:42電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 49,927+4 -1表示差分選択
2010/6/11 6:15:47電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 49,650+14 -8表示差分選択
2010/6/9 23:04:36電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 49,417+18 -4表示差分選択
2010/6/9 15:06:18電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 48,939+410 -56表示差分選択
2010/6/9 12:28:42電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 36,408+198 -38表示差分選択
2010/6/8 22:51:24電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 31,013+13 -0表示差分選択
2010/6/8 15:49:16電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 30,703+2 -0表示差分選択
2010/6/3 11:50:45電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 30,627+19 -6表示差分選択
2010/6/2 10:48:00電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 29,082+20 -0表示差分選択
2010/6/2 2:55:20電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 28,406+1 -0表示差分選択
2010/6/1 20:01:56電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 28,190+138 -216表示差分選択
2010/6/1 13:53:18電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 59,782+181 -0表示表示中選択
2010/5/31 6:16:21電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 52,283+61 -0表示差分選択
2010/5/31 6:16:21電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 50,925+690 -243表示差分基準
2010/5/31 0:51:00電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 5,930+243 -227表示差分選択
2010/5/30 7:37:59電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 5,029+40 -20表示差分選択
2010/5/30 7:37:59電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 4,530+102 -36表示差分選択
2010/5/30 3:01:52電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス 3,082— —表示—選択

基準: 電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス (2010/5/31 6:16:21) → 比較: 電気回路/HDL/Xilinx Memory Interface Generator (MIG) による DDR2 SDRAM のアクセス (2010/6/1 13:53:18)

@@ -91,6 +91,8 @@
|Class for Data|Class II|
|Debug Signals for Memory Controller|Disable|
+- (2010/06/01追記) DQS# Enable は Disable にしないと MAP でこけることが分かりました。
+
** Available/Reserved ピンは指定しない [#c95111af]
つぎにピン配置を決めるのですが・・・
@@ -634,6 +636,184 @@
とりあえず、これで先に進めます。
+** MAP でエラー [#lacd5291]
+
+上記設定で作ったコアを組み込んでプロジェクトをコンパイルしたら、
+MAP 段階で以下のエラーが出ました。
+
+ ERROR:PhysDesignRules:760 - Incompatible programming for IO standard. IO
+ standard LVDS_25 of comp ddr2_dqs<0> does not allow both input and output
+ programming on the same comp.
+ ERROR:PhysDesignRules:760 - Incompatible programming for IO standard. IO
+ standard LVDS_25 of comp ddr2_dqs<1> does not allow both input and output
+ programming on the same comp.
+ ERROR:PhysDesignRules:760 - Incompatible programming for IO standard. IO
+ standard LVDS_25 of comp ddr2_dqs<2> does not allow both input and output
+ programming on the same comp.
+ ERROR:PhysDesignRules:760 - Incompatible programming for IO standard. IO
+ standard LVDS_25 of comp ddr2_dqs<3> does not allow both input and output
+ programming on the same comp.
+ ERROR:Pack:1642 - Errors in physical DRC.
+
+そもそも .ucf には
+ NET "cntrl0_ddr2_dqs[*]" IOSTANDARD = DIFF_SSTL18_II;
+ NET "cntrl0_ddr2_dqs_n[*]" IOSTANDARD = DIFF_SSTL18_II;
+
+と書かれているので、なぜ上記エラーが出るのかまったく不明なのですが・・・
+
+http://forums.xilinx.com/t5/Old-ISE-Board-no-new-thread/Error-compilation-with-MIG-DDR2-Spartan-3an/m-p/13532 によれば MIG のオプションで DQS# enable --> disable(1) の変更が必要だそうです?
+
+仕方がないので、これを試すことにしました。
+
+で、もう一度始めから Create Design するのは面倒だったので、
+.prj ファイルのパラメータを変更して Verify UCF and Update Design and UCF してみたところ、
+ちゃんと Summary 画面で
+ DQS# Enable : Disable(1)
+
+となっていました。
+
+その次の画面で
+
+ ERROR: Differential dqs[3] is disabled in MIG project file but the pin out is found in UCF
+ ERROR: Differential dqs[2] is disabled in MIG project file but the pin out is found in UCF
+ ERROR: Differential dqs[1] is disabled in MIG project file but the pin out is found in UCF
+ ERROR: Differential dqs[0] is disabled in MIG project file but the pin out is found in UCF
+
+なるエラーが出たので、.ucf ファイルから
+
+ NET "cntrl0_ddr2_dqs_n[0]"
+
+などの行をすべて削除してもう一度読み込ませたところ、
+
+ Verification Report
+
+ Reading design libraries of xc3sd1800a-fg676... successful !
+
+ /*******************************************************/
+ /* Controller 0
+ /*******************************************************/
+ Checking pins allocated to Data bits ...
+ Checking pins allocated to Strobe bits ...
+ Checking pins allocated to Clock bits ...
+ Checking pins allocated to Address bits ...
+ Checking pins allocated to BankAddress bits ...
+ Verification Successful.
+ All signals in the UCF were allocated correctly.
+
+として、正しくコアを生成できました。
+
+生成されたコアからは cntrl0_ddr2_dqs_n というピンが無くなっていました。
+
+これで MAP は通るようになりました。
+
+** 次は PAR でエラー [#dabcd115]
+
+MAP は通ったものの、次は PAR でエラーです。
+
+Post-MAP Static Timing では All constraints were met.
+となっているにもかかわらず、次のエラーが出てしまいます。
+
+ ERROR:Par:228 - At least one timing constraint is impossible to meet because component delays
+ alone exceed the constraint. A timing constraint summary below shows the failing constraints
+ (preceded with an Asterisk (*)). Please use the Timing Analyzer (GUI) or TRCE (command line)
+ with the Mapped NCD and PCF files to identify which constraints and paths are failing because
+ of the component delays alone. If the failing path(s) is mapped to Xilinx components as
+ expected, consider relaxing the constraint. If it is not mapped to components as expected,
+ re-evaluate your HDL and how synthesis is optimizing the path. To allow the tools to bypass
+ this error, set the environment variable XIL_TIMING_ALLOW_IMPOSSIBLE to 1.
+
+ For more information about the Timing Analyzer, consult the Xilinx Timing Analyzer Reference
+ manual; for more information on TRCE, consult the Xilinx Command Line Tools User Guide "TRACE"
+ chapter.
+
+その後のメッセージから特定される箇所は、
+
+| Constraint | Check | Worst Case Slack | Best Case Achievable | Timing Errors | Timing Score |
+|* TS_clock_gen_clk_125MHz90_pre = PERIOD TIMEGRP "clock_gen_clk_125MHz90_pre" TS_clk_125MHz_in PHASE 2 ns HIGH 50% | SETUP | -0.926ns| 11.704ns| 4| 2202|
+|~| HOLD | 0.399ns| | 0| 0|
+
+で、これはちょうど MI コアとのインタフェース部分のクロックなのですが、
+Post-MAP Static Timing では周期の 8ns に対して setup path は 3.389 と表示されており、
+当然エラーにはならないはずなのです。
+
+これでは何が悪いのか分からないので困ってしまうのですが・・・
+
+メッセージを参考に、XIL_TIMING_ALLOW_IMPOSSIBLE という環境変数に 1
+を設定して再度トライしたところ、数多く出力されるメッセージの中に
+
+ WARNING:Place:414 - The input design contains local clock signal(s). To get a better result,
+ we recommend users run map with the "-timing" option set before starting the placement.
+
+というのがありました。
+
+MIG の生成するコアは negedge clk0 に同期した信号を要求するので、
+そのために local clock signals が使われているとのメッセージが出ているのだと思います。
+
+そして、このせいで Post-MAP Static Timing で正しい見積もりが出せなかったということでしょうか。
+
+実際 XIL_TIMING_ALLOW_IMPOSSIBLE で無理矢理通した後の、
+Post-PAR Static Timing を見ても、それらしいエラーが出ていません(困
+
+そこで、Map の Process Properties の Other Map Command Line Options に
+~-timing を記入してトライしたところ、Phase 4.2 Initial Clock and IO Placement で
+ものすっごく時間が掛かるようになりました。
+
+というか・・・CPUを100%使い切ったまま10分以上返ってこないです?!
+
+** negedge clk0 を posedge clk180 で書き直す [#j3e6a084]
+
+negedge clk0 のクロックドメインは後述するステートマシン部だけなので、
+それほど大きなドメインではないのですが、local というには大きくて、
+それが MAP に負担が掛かっている、ということでしょうか。
+
+これらの信号を生成するためにもう1つクロック線を使って、
+ユーザーコード側で negedge clk0 が必要な部分を、
+180 度位相の異なる clk180 の posedge で動かすことにしました。
+
+うーん、まだだめですね。Phase 4.2 から戻ってきません。
+~-timing オプションを付けると map が終了しないのは、回避の仕方が分かりません。
+
+~-timing オプションを取ってみたところ、新たに PAR でエラーが出て、
+たぶん BUFG が足りないと言うことのようです。
+
+ ERROR:Place:962 - A DCM / BUFGCTRL clock component pair have been found that are not placed at an optimal DCM / BUFGCTRL
+ site pair. The DCM component <clock_gen/DCM_SP_inst> is locked to site <DCM_X1Y3> and the corresponding BUFGCTRL
+ component <clock_gen/clk_125MHz90_bufg> is locked to site <BUFGMUX_X1Y1>. This will not allow the usage of the fast
+ path between the DCM and the Clock buffer. If this sub optimal condition is acceptable for this design, you may use
+ the CLOCK_DEDICATED_ROUTE constraint in the .ucf file to demote this message to a WARNING and allow your design to
+ continue. However, the use of this override is highly discouraged as it may lead to very poor timing results. It is
+ recommended that this error condition be corrected in the design. A list of all the COMP.PINs used in this clock
+ placement rule is listed below. These examples can be used directly in the .ucf file to override this clock rule.
+ < PIN "clock_gen/DCM_SP_inst.CLK90" CLOCK_DEDICATED_ROUTE = FALSE; >
+
+ゴールは遠い感じです。
+
+** 気になるメッセージ [#v9396154]
+
+PAR 時にいくつか気になるメッセージが出ていたので、
+実際には後で対処するとして、忘れないようとりあえずここにメモしておきます。
+
+ INFO:Place:834 - Only a subset of IOs are locked. Out of 97 IOs, 39 are locked and 58 are not
+ locked. If you would like to print the names of these IOs, please set the environment variable
+ XIL_PAR_DESIGN_CHECK_VERBOSE to 1.
+
+メモリと接続されるピン配置が合ってません。
+もしかして、MIG の生成した .ucf がまったく効いていない?
+
+何か根本的な手順が抜けているのかもしれません・・・
+
+ただ、MIG の生成した .ucf ファイルを指定して明示的にプロジェクトに追加しようとすると
+すでにプロジェクトに含まれるため追加できない旨のエラーメッセージが出るので、
+入っていない訳じゃないみたいなんですが・・・
+
+ WARNING:Place:619 - This design is using a Side-BUFG site due to placement constraints on a BUFG,
+ DCM, clock IOB or the loads of these components. It is recommended that Top and Bottom BUFG sites
+ be used instead of Side-BUFG sites whenever possible because they can reach every clock region on
+ the device. Side-BUFG sites can reach only clock regions on the same side of the device and also
+ preclude the use of certain Top and Bottom BUFGs in the same clock region.
+
+これも要チェック。
+
* MIG が生成したコアを使って Spartan 3A DSP から DDR2 メモリにアクセスする [#p0f9bc5f]
まだ準備段階です。
@@ -687,6 +867,68 @@
という設定であることが分かります。
+** 初期化 [#ub9bfa1e]
+
+MI からは
+- cntrl0_sys_rst_tb
+- cntrl0_sys_rst90_tb
+- cntrl0_sys_rst180_tb
+
+の3つのリセット信号が出力されます。
+
+SDRAM の初期化時間を 200us 取らなければならないため、
+システムリセット後 200us 以上にわたりこれらの信号は 1 の値を取ります。
+
+これらすべてが 0 に下りたのを確認した後、
+negedge clk0 に同期して mi_command に Initialize memory (3'b010) を1クロックだけ送り、
+init_done が上がるのを待てば初期化が終了します。
+
+シミュレーション時には MI のコンパイル時に simulation という定数を `define
+しておけばこの 200us (実際には 280us 程度)を待たずに済みます。
+
+ISE から ModelSim を使ってシミュレーションするのであれば、
+"Simulate Behavioral Model" などの上で右クリックして、
+[Process Properties...] から [Other VLOG Command Line Options] に
+"+define+simulation" ("" は除く) を記入しておくのが手軽です。
+
+** 読み書き [#v30db95a]
+
+32bit のメモリにアクセスする場合、MI とは 64bit のデータをやりとりします。
+
+書き込みでは、上位 32bit が先に、下位 32bit が後に、デバイスに送られます。
+
+読み込みでは、先に受信した方を上位に、後に受信した方を下位に詰めて渡されます。
+
+アドレスは clk0 の negedge に同期して、~
+データは clk90 の posedge に同期して、~
+やりとりされることになっています。
+
+この取り決めに始め戸惑いましたが、よく見てみると難しいことはないようです。
+
+- ステートマシンは negedge clk0 同期で作成する
+-- read も write も、アドレスや burst done の出力タイミングは同じでよい
+- データを扱う posedge clk90 ドメインは
+-- read では data_valid だけ見てデータを取り込めばよい
+-- write では cmd_ack が立った次のクロックからデータを書き出せばよい
+
+という単純な話でした。
+
+write の際に、
+negedge clk0 で遷移する信号を~
+posedge clk90 ドメインで読み取る必要が生じるのですが、~
+fifo をうまく使えばそのままで十分にセットアップ時間が取れるため、
+普通に書いてしまって大丈夫でした。
+
+ツールが位相違いのクロックをちゃんと認識してセットアップ・ホールド
+時間解析をしてくれるのでこういう使い方ができるのですね。
+
+サブクロックの最適化が必要になるような高速回路の設計について、
+その片鱗が見えた気がしました。
+
+以上、まだシミュレーション段階でうまく行きそう、という段階なので、
+これからが正念場です(汗
+
+
* メモ [#s277dbef]
- Invalid property "SYN_USEIOFF 1" というワーニングは XST が Synplify 用の制約である SYN_USEIOFF を認識できないために出るものなので、無視して良さそうです。